//
// Copyright (c) 1996 Molecular Structure Corporation
//
// RESTRICTED RIGHTS NOTICE SHORT FORM (JUNE 1987)
//
// Use, reproduction, or disclosure is subject to restrictions set
// forth in Contract No. W-31-109-ENG-38 and Contract No. 
// 943072401 with the University of Chicago, Operator of
// Argonne National Laboratory.
//
// CUIeditheader.cc       Initial author: J.W. Pflugrath           14-Nov-1996
//    This file implements interface class CUIeditheader.
/*
 *
 * Copyright (C) 2014 Rigaku Americas Corporation
 *                    9009 New Trails Drive
 *                    The Woodlands, TX, USA  77381
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *    * Redistributions of source code must retain the above copyright
 *      notice(s), this list of conditions and the following disclaimer.
 *    * Redistributions in binary form must reproduce the above copyright
 *      notice(s), this list of conditions and the following disclaimer in the
 *      documentation and/or other materials provided with the distribution.
 *    * Neither the name of the Rigaku Americas Corporation nor the 
 *      names of its contributors may be used to endorse or promote products
 *      derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL RIGAKU AMERICAS CORPORATION BE LIABLE 
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA OR PROFITS; OR BUSINESS INTERUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 *
*/ 

//
// README: Portions of this file are merged at file generation
// time. Edits can be made *only* in between specified code blocks, look
// for keywords <Begin user code> and <End user code>.
//
/////////////////////////////////////////////////////////////
//
// Source file for CUIeditheader
//
//    This file generated by Builder Xcessory 3.5.1.
//
//    This class is a user interface "component", as described
//    in "Object-Oriented Programming with C++ and OSF/Motif",
//    by Douglas Young, Prentice Hall, 1992. ISBN 0-13-630252-1
//
/////////////////////////////////////////////////////////////
#include <X11/StringDefs.h>
#include <Xm/SelectioB.h>
#include <Xm/Form.h>
#include <Xm/Separator.h>
#include <Xm/ScrolledW.h>
#include <Xm/Text.h>
#include <Xm/Label.h>
#include <Xm/TextF.h>
#include <Xm/PushB.h>
#include "CUIeditheader.h"

//
// Convenience functions from utilities file.
//
extern void RegisterBxConverters(XtAppContext);
extern XtPointer CONVERT(Widget, char *, char *, int, Boolean *);
extern XtPointer DOUBLE(double);
extern XtPointer SINGLE(float);
extern void MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
extern Pixmap XPM_PIXMAP(Widget, char**);
extern void SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal*, Pixel);


// Begin user code block <head> 
// End user code block <head> 

//
// This table is used to define class resources that are placed
// in app-defaults. This table is necessary so each instance
// of this class has the proper default resource values set.
// This eliminates the need for each instance to have
// its own app-defaults values. This table must be NULL terminated.
//
#if defined(cxx_bx_compat)

Boolean CUIeditheader::_initAppDefaults = True;
UIAppDefault  CUIeditheader::_appDefaults[] = {
    {"", NULL, "dialogTitle", NULL},
    {"twEditHeadCrysDesc", NULL, "value", NULL},
    {"lbEditHeadCrysDesc", NULL, "labelString", NULL},
    {"tfEditHeadBeamPosn", NULL, "value", NULL},
    {"lbEditHeadBeamPosn", NULL, "labelString", NULL},
    {"pbEditHeadSpacegroup", NULL, "labelString", NULL},
    {"twEditHeadComment", NULL, "value", NULL},
    {"tfEditHeadSpacegroup", NULL, "value", NULL},
    {"tfEditHeadMosaicity", NULL, "value", NULL},
    {"tfEditHeadOrient3", NULL, "value", NULL},
    {"tfEditHeadOrient2", NULL, "value", NULL},
    {"tfEditHeadOrient1", NULL, "value", NULL},
    {"tfEditHeadCellGam", NULL, "value", NULL},
    {"tfEditHeadCellBet", NULL, "value", NULL},
    {"tfEditHeadCellAlp", NULL, "value", NULL},
    {"tfEditHeadCellC", NULL, "value", NULL},
    {"tfEditHeadCellB", NULL, "value", NULL},
    {"tfEditHeadCellA", NULL, "value", NULL},
    {"lbEditHeadComment", NULL, "labelString", NULL},
    {"lbEditHeadSpacegroup", NULL, "labelString", NULL},
    {"lbEditHeadMosaicity", NULL, "labelString", NULL},
    {"lbEditHeadOrientation", NULL, "labelString", NULL},
    {"lbEditHeadCell", NULL, "labelString", NULL},
    {NULL, NULL, NULL, NULL}
};
#endif

// These are default resources for widgets in objects of this class
// All resources will be prepended by *<name> at instantiation,
// where <name> is the name of the specific instance, as well as the
// name of the baseWidget. These are only defaults, and may be overriden
// in a resource file by providing a more specific resource name

String  CUIeditheader::_defaultCUIeditheaderResources[] = {
        NULL
};

//
// Old style constructor, for compatibility only.
//
CUIeditheader::CUIeditheader(const char *name, Widget parent) : 
    UIComponent(name)
{
    
    // Begin user code block <alt_constructor> 
    // End user code block <alt_constructor> 
    create(parent);
}

//
// Class constructor.
//
CUIeditheader::CUIeditheader(const char *name) : UIComponent(name)
{
    
    // Begin user code block <constructor> 
  m_sFormat1 = "%.3f";
  m_sFormat2 = "%.4f";
  m_prvCallback = NULL;
  m_tEditHeader.dCrysCell[0]    = 1.0;
  m_tEditHeader.dCrysCell[1]    = 2.0;
  m_tEditHeader.dCrysCell[2]    = 3.0;
  m_tEditHeader.dCrysCell[3]    = 90.0;
  m_tEditHeader.dCrysCell[4]    = 90.0;
  m_tEditHeader.dCrysCell[5]    = 90.0;
  m_tEditHeader.dCrysRot[0]     = 0.0;
  m_tEditHeader.dCrysRot[1]     = 0.0;
  m_tEditHeader.dCrysRot[2]     = 0.0;
  m_tEditHeader.dCrysMosaicity  = 0.2;
  m_tEditHeader.nCrysSpacegroup = 1;
  m_tEditHeader.dBeamPosition[0]= 0.0;
  m_tEditHeader.dBeamPosition[1]= 0.0;
  m_tEditHeader.sCrysDescription= "No crystal description.";
  m_tEditHeader.sComment        = "No comment.";
    // End user code block <constructor> 
}

//
// Minimal Destructor. Base class destroys widgets.
//
CUIeditheader::~CUIeditheader() 
{
    
    // Begin user code block <destructor> 
  if (NULL != m_poXhelp)
    {
      delete m_poXhelp;
      m_poXhelp = NULL;
    }
    // End user code block <destructor> 
    delete _clientDataStructs;
}

//
// Handle creation of all widgets in the class.
//
void CUIeditheader::create(Widget parent) 
{
    Arg      args[256];
    Cardinal ac=0;
    Boolean  argok=False;
    
    //
    // Load any class-defaulted resources for this object.
    //
    setDefaultResources(parent, _defaultCUIeditheaderResources);
    
#if defined(cxx_bx_compat)
    //
    // Setup app-defaults fallback table if not already done.
    //
    if (_initAppDefaults)
    {
        initAppDefaults(parent, "CUIeditheader", _appDefaults);
        _initAppDefaults = False;
    }
    //
    // Now set the app-defaults for this instance.
    //
    setAppDefaults(parent, _appDefaults);
#endif
    
    //
    // Register the converters for the widgets.
    //
    RegisterBxConverters(XtWidgetToApplicationContext(parent)); 
    XtInitializeWidgetClass(xmSelectionBoxWidgetClass);
    XtInitializeWidgetClass(xmFormWidgetClass);
    XtInitializeWidgetClass(xmSeparatorWidgetClass);
    XtInitializeWidgetClass(xmScrolledWindowWidgetClass);
    XtInitializeWidgetClass(xmTextWidgetClass);
    XtInitializeWidgetClass(xmLabelWidgetClass);
    XtInitializeWidgetClass(xmTextFieldWidgetClass);
    XtInitializeWidgetClass(xmPushButtonWidgetClass);
    
    //
    // Create an unmanaged widget as the top of the hierarchy.
    //
    
    ac = 0;
    XtSetArg(args[ac], XmNdialogType, XmDIALOG_PROMPT); ac++;
    XtSetArg(args[ac], XmNx, 29); ac++;
    XtSetArg(args[ac], XmNy, 99); ac++;
    XtSetArg(args[ac], XmNwidth, 567); ac++;
    XtSetArg(args[ac], XmNheight, 658); ac++;
    _CUIeditheader = XmCreateSelectionBox(parent,
        _name,
        args, 
        ac);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_CUIeditheader,
        XmNhelpCallback,
        CUIeditheader::vEditHeaderCBCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_CUIeditheader,
        XmNokCallback,
        CUIeditheader::vEditHeaderCBCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_CUIeditheader,
        XmNapplyCallback,
        CUIeditheader::vEditHeaderCBCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_CUIeditheader,
        XmNcancelCallback,
        CUIeditheader::vEditHeaderCBCallback,
        (XtPointer)_clientDataStructs);
    
    _w = _CUIeditheader;
    //
    // Install callback to guard against unexpected widget destruction..
    //
    installDestroyHandler();
    
    ac = 0;
    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_ANY); ac++;
    XtSetArg(args[ac], XmNx, 11); ac++;
    XtSetArg(args[ac], XmNy, 11); ac++;
    XtSetArg(args[ac], XmNwidth, 545); ac++;
    XtSetArg(args[ac], XmNheight, 499); ac++;
    _fmEditHeader = XmCreateForm(_CUIeditheader,
        "fmEditHeader",
        args, 
        ac);
    XtManageChild(_fmEditHeader);
    
    ac = 0;
    XtSetArg(args[ac], XmNx, 0); ac++;
    XtSetArg(args[ac], XmNy, 329); ac++;
    XtSetArg(args[ac], XmNwidth, 545); ac++;
    XtSetArg(args[ac], XmNheight, 10); ac++;
    _separator = XmCreateSeparator(_fmEditHeader,
        "separator",
        args, 
        ac);
    XtManageChild(_separator);
    
    ac = 0;
    XtSetArg(args[ac], XmNscrollingPolicy, XmAPPLICATION_DEFINED); ac++;
    XtSetArg(args[ac], XmNx, 175); ac++;
    XtSetArg(args[ac], XmNy, 255); ac++;
    XtSetArg(args[ac], XmNwidth, 352); ac++;
    XtSetArg(args[ac], XmNheight, 74); ac++;
    _swEditHeadCrysDesc = XmCreateScrolledWindow(_fmEditHeader,
        "swEditHeadCrysDesc",
        args, 
        ac);
    XtManageChild(_swEditHeadCrysDesc);
    
    ac = 0;
    XtSetArg(args[ac], XmNeditMode, XmMULTI_LINE_EDIT); ac++;
    XtSetArg(args[ac], XmNheight, 55); ac++;
    _twEditHeadCrysDesc = XmCreateText(_swEditHeadCrysDesc,
        "twEditHeadCrysDesc",
        args, 
        ac);
    XtManageChild(_twEditHeadCrysDesc);
    
    ac = 0;
    XtSetArg(args[ac], XmNtraversalOn, False); ac++;
    XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
    XtSetArg(args[ac], XmNx, 0); ac++;
    XtSetArg(args[ac], XmNy, 250); ac++;
    XtSetArg(args[ac], XmNwidth, 165); ac++;
    XtSetArg(args[ac], XmNheight, 30); ac++;
    _lbEditHeadCrysDesc = XmCreateLabel(_fmEditHeader,
        "lbEditHeadCrysDesc",
        args, 
        ac);
    XtManageChild(_lbEditHeadCrysDesc);
    
    ac = 0;
    XtSetArg(args[ac], XmNuserData, 20010); ac++;
    XtSetArg(args[ac], XmNx, 175); ac++;
    XtSetArg(args[ac], XmNy, 339); ac++;
    XtSetArg(args[ac], XmNwidth, 165); ac++;
    XtSetArg(args[ac], XmNheight, 40); ac++;
    _tfEditHeadBeamPosn = XmCreateTextField(_fmEditHeader,
        "tfEditHeadBeamPosn",
        args, 
        ac);
    XtManageChild(_tfEditHeadBeamPosn);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadBeamPosn,
        XmNactivateCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadBeamPosn,
        XmNlosingFocusCallback,
        CUIeditheader::vUnPostHelpCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadBeamPosn,
        XmNlosingFocusCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    
    ac = 0;
    XtSetArg(args[ac], XmNtraversalOn, False); ac++;
    XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
    XtSetArg(args[ac], XmNx, 0); ac++;
    XtSetArg(args[ac], XmNy, 343); ac++;
    XtSetArg(args[ac], XmNwidth, 165); ac++;
    XtSetArg(args[ac], XmNheight, 30); ac++;
    _lbEditHeadBeamPosn = XmCreateLabel(_fmEditHeader,
        "lbEditHeadBeamPosn",
        args, 
        ac);
    XtManageChild(_lbEditHeadBeamPosn);
    
    ac = 0;
    XtSetArg(args[ac], XmNsensitive, False); ac++;
    XtSetArg(args[ac], XmNx, 300); ac++;
    XtSetArg(args[ac], XmNy, 193); ac++;
    XtSetArg(args[ac], XmNwidth, 35); ac++;
    XtSetArg(args[ac], XmNheight, 35); ac++;
    _pbEditHeadSpacegroup = XmCreatePushButton(_fmEditHeader,
        "pbEditHeadSpacegroup",
        args, 
        ac);
    XtManageChild(_pbEditHeadSpacegroup);
    
    ac = 0;
    XtSetArg(args[ac], XmNscrollingPolicy, XmAPPLICATION_DEFINED); ac++;
    XtSetArg(args[ac], XmNx, 0); ac++;
    XtSetArg(args[ac], XmNy, 420); ac++;
    XtSetArg(args[ac], XmNwidth, 545); ac++;
    XtSetArg(args[ac], XmNheight, 79); ac++;
    _swEditHeadComment = XmCreateScrolledWindow(_fmEditHeader,
        "swEditHeadComment",
        args, 
        ac);
    XtManageChild(_swEditHeadComment);
    
    ac = 0;
    XtSetArg(args[ac], XmNeditMode, XmMULTI_LINE_EDIT); ac++;
    XtSetArg(args[ac], XmNheight, 60); ac++;
    _twEditHeadComment = XmCreateText(_swEditHeadComment,
        "twEditHeadComment",
        args, 
        ac);
    XtManageChild(_twEditHeadComment);
    
    ac = 0;
    XtSetArg(args[ac], XmNuserData, 20011); ac++;
    XtSetArg(args[ac], XmNx, 175); ac++;
    XtSetArg(args[ac], XmNy, 190); ac++;
    XtSetArg(args[ac], XmNwidth, 120); ac++;
    XtSetArg(args[ac], XmNheight, 40); ac++;
    _tfEditHeadSpacegroup = XmCreateTextField(_fmEditHeader,
        "tfEditHeadSpacegroup",
        args, 
        ac);
    XtManageChild(_tfEditHeadSpacegroup);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadSpacegroup,
        XmNactivateCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadSpacegroup,
        XmNlosingFocusCallback,
        CUIeditheader::vUnPostHelpCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadSpacegroup,
        XmNlosingFocusCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    
    ac = 0;
    XtSetArg(args[ac], XmNuserData, 20010); ac++;
    XtSetArg(args[ac], XmNx, 175); ac++;
    XtSetArg(args[ac], XmNy, 140); ac++;
    XtSetArg(args[ac], XmNwidth, 120); ac++;
    XtSetArg(args[ac], XmNheight, 40); ac++;
    _tfEditHeadMosaicity = XmCreateTextField(_fmEditHeader,
        "tfEditHeadMosaicity",
        args, 
        ac);
    XtManageChild(_tfEditHeadMosaicity);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadMosaicity,
        XmNactivateCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadMosaicity,
        XmNlosingFocusCallback,
        CUIeditheader::vUnPostHelpCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadMosaicity,
        XmNlosingFocusCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    
    ac = 0;
    XtSetArg(args[ac], XmNuserData, 20009); ac++;
    XtSetArg(args[ac], XmNx, 425); ac++;
    XtSetArg(args[ac], XmNy, 90); ac++;
    XtSetArg(args[ac], XmNwidth, 120); ac++;
    XtSetArg(args[ac], XmNheight, 40); ac++;
    _tfEditHeadOrient3 = XmCreateTextField(_fmEditHeader,
        "tfEditHeadOrient3",
        args, 
        ac);
    XtManageChild(_tfEditHeadOrient3);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadOrient3,
        XmNactivateCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadOrient3,
        XmNlosingFocusCallback,
        CUIeditheader::vUnPostHelpCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadOrient3,
        XmNlosingFocusCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    
    ac = 0;
    XtSetArg(args[ac], XmNuserData, 20008); ac++;
    XtSetArg(args[ac], XmNx, 300); ac++;
    XtSetArg(args[ac], XmNy, 90); ac++;
    XtSetArg(args[ac], XmNwidth, 120); ac++;
    XtSetArg(args[ac], XmNheight, 40); ac++;
    _tfEditHeadOrient2 = XmCreateTextField(_fmEditHeader,
        "tfEditHeadOrient2",
        args, 
        ac);
    XtManageChild(_tfEditHeadOrient2);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadOrient2,
        XmNactivateCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadOrient2,
        XmNlosingFocusCallback,
        CUIeditheader::vUnPostHelpCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadOrient2,
        XmNlosingFocusCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    
    ac = 0;
    XtSetArg(args[ac], XmNuserData, 20007); ac++;
    XtSetArg(args[ac], XmNx, 175); ac++;
    XtSetArg(args[ac], XmNy, 90); ac++;
    XtSetArg(args[ac], XmNwidth, 120); ac++;
    XtSetArg(args[ac], XmNheight, 40); ac++;
    _tfEditHeadOrient1 = XmCreateTextField(_fmEditHeader,
        "tfEditHeadOrient1",
        args, 
        ac);
    XtManageChild(_tfEditHeadOrient1);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadOrient1,
        XmNactivateCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadOrient1,
        XmNlosingFocusCallback,
        CUIeditheader::vUnPostHelpCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadOrient1,
        XmNlosingFocusCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    
    ac = 0;
    XtSetArg(args[ac], XmNuserData, 20006); ac++;
    XtSetArg(args[ac], XmNx, 425); ac++;
    XtSetArg(args[ac], XmNy, 40); ac++;
    XtSetArg(args[ac], XmNwidth, 120); ac++;
    XtSetArg(args[ac], XmNheight, 40); ac++;
    _tfEditHeadCellGam = XmCreateTextField(_fmEditHeader,
        "tfEditHeadCellGam",
        args, 
        ac);
    XtManageChild(_tfEditHeadCellGam);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadCellGam,
        XmNactivateCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadCellGam,
        XmNlosingFocusCallback,
        CUIeditheader::vUnPostHelpCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadCellGam,
        XmNlosingFocusCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    
    ac = 0;
    XtSetArg(args[ac], XmNuserData, 20005); ac++;
    XtSetArg(args[ac], XmNx, 300); ac++;
    XtSetArg(args[ac], XmNy, 40); ac++;
    XtSetArg(args[ac], XmNwidth, 120); ac++;
    XtSetArg(args[ac], XmNheight, 40); ac++;
    _tfEditHeadCellBet = XmCreateTextField(_fmEditHeader,
        "tfEditHeadCellBet",
        args, 
        ac);
    XtManageChild(_tfEditHeadCellBet);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadCellBet,
        XmNactivateCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadCellBet,
        XmNlosingFocusCallback,
        CUIeditheader::vUnPostHelpCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadCellBet,
        XmNlosingFocusCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    
    ac = 0;
    XtSetArg(args[ac], XmNuserData, 20004); ac++;
    XtSetArg(args[ac], XmNx, 175); ac++;
    XtSetArg(args[ac], XmNy, 40); ac++;
    XtSetArg(args[ac], XmNwidth, 120); ac++;
    XtSetArg(args[ac], XmNheight, 40); ac++;
    _tfEditHeadCellAlp = XmCreateTextField(_fmEditHeader,
        "tfEditHeadCellAlp",
        args, 
        ac);
    XtManageChild(_tfEditHeadCellAlp);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadCellAlp,
        XmNactivateCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadCellAlp,
        XmNlosingFocusCallback,
        CUIeditheader::vUnPostHelpCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadCellAlp,
        XmNlosingFocusCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    
    ac = 0;
    XtSetArg(args[ac], XmNuserData, 20003); ac++;
    XtSetArg(args[ac], XmNx, 425); ac++;
    XtSetArg(args[ac], XmNy, 0); ac++;
    XtSetArg(args[ac], XmNwidth, 120); ac++;
    XtSetArg(args[ac], XmNheight, 40); ac++;
    _tfEditHeadCellC = XmCreateTextField(_fmEditHeader,
        "tfEditHeadCellC",
        args, 
        ac);
    XtManageChild(_tfEditHeadCellC);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadCellC,
        XmNactivateCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadCellC,
        XmNlosingFocusCallback,
        CUIeditheader::vUnPostHelpCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadCellC,
        XmNlosingFocusCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    
    ac = 0;
    XtSetArg(args[ac], XmNuserData, 20002); ac++;
    XtSetArg(args[ac], XmNx, 300); ac++;
    XtSetArg(args[ac], XmNy, 0); ac++;
    XtSetArg(args[ac], XmNwidth, 120); ac++;
    XtSetArg(args[ac], XmNheight, 40); ac++;
    _tfEditHeadCellB = XmCreateTextField(_fmEditHeader,
        "tfEditHeadCellB",
        args, 
        ac);
    XtManageChild(_tfEditHeadCellB);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadCellB,
        XmNactivateCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadCellB,
        XmNlosingFocusCallback,
        CUIeditheader::vUnPostHelpCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadCellB,
        XmNlosingFocusCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    
    ac = 0;
    XtSetArg(args[ac], XmNuserData, 20001); ac++;
    XtSetArg(args[ac], XmNx, 175); ac++;
    XtSetArg(args[ac], XmNy, 0); ac++;
    XtSetArg(args[ac], XmNwidth, 120); ac++;
    XtSetArg(args[ac], XmNheight, 40); ac++;
    _tfEditHeadCellA = XmCreateTextField(_fmEditHeader,
        "tfEditHeadCellA",
        args, 
        ac);
    XtManageChild(_tfEditHeadCellA);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadCellA,
        XmNactivateCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadCellA,
        XmNlosingFocusCallback,
        CUIeditheader::vUnPostHelpCallback,
        (XtPointer)_clientDataStructs);
    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = this;
    _clientDataStructs->client_data = (XtPointer)0;
    XtAddCallback(_tfEditHeadCellA,
        XmNlosingFocusCallback,
        CUIeditheader::vTextFieldCBCallback,
        (XtPointer)_clientDataStructs);
    
    ac = 0;
    XtSetArg(args[ac], XmNtraversalOn, False); ac++;
    XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
    XtSetArg(args[ac], XmNx, 0); ac++;
    XtSetArg(args[ac], XmNy, 385); ac++;
    XtSetArg(args[ac], XmNwidth, 165); ac++;
    XtSetArg(args[ac], XmNheight, 30); ac++;
    _lbEditHeadComment = XmCreateLabel(_fmEditHeader,
        "lbEditHeadComment",
        args, 
        ac);
    XtManageChild(_lbEditHeadComment);
    
    ac = 0;
    XtSetArg(args[ac], XmNtraversalOn, False); ac++;
    XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
    XtSetArg(args[ac], XmNx, 0); ac++;
    XtSetArg(args[ac], XmNy, 195); ac++;
    XtSetArg(args[ac], XmNwidth, 165); ac++;
    XtSetArg(args[ac], XmNheight, 30); ac++;
    _lbEditHeadSpacegroup = XmCreateLabel(_fmEditHeader,
        "lbEditHeadSpacegroup",
        args, 
        ac);
    XtManageChild(_lbEditHeadSpacegroup);
    
    ac = 0;
    XtSetArg(args[ac], XmNtraversalOn, False); ac++;
    XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
    XtSetArg(args[ac], XmNx, 0); ac++;
    XtSetArg(args[ac], XmNy, 145); ac++;
    XtSetArg(args[ac], XmNwidth, 165); ac++;
    XtSetArg(args[ac], XmNheight, 30); ac++;
    _lbEditHeadMosaicity = XmCreateLabel(_fmEditHeader,
        "lbEditHeadMosaicity",
        args, 
        ac);
    XtManageChild(_lbEditHeadMosaicity);
    
    ac = 0;
    XtSetArg(args[ac], XmNtraversalOn, False); ac++;
    XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
    XtSetArg(args[ac], XmNx, 0); ac++;
    XtSetArg(args[ac], XmNy, 95); ac++;
    XtSetArg(args[ac], XmNwidth, 165); ac++;
    XtSetArg(args[ac], XmNheight, 30); ac++;
    _lbEditHeadOrientation = XmCreateLabel(_fmEditHeader,
        "lbEditHeadOrientation",
        args, 
        ac);
    XtManageChild(_lbEditHeadOrientation);
    
    ac = 0;
    XtSetArg(args[ac], XmNtraversalOn, False); ac++;
    XtSetArg(args[ac], XmNalignment, XmALIGNMENT_END); ac++;
    XtSetArg(args[ac], XmNx, 0); ac++;
    XtSetArg(args[ac], XmNy, 0); ac++;
    XtSetArg(args[ac], XmNwidth, 165); ac++;
    XtSetArg(args[ac], XmNheight, 30); ac++;
    _lbEditHeadCell = XmCreateLabel(_fmEditHeader,
        "lbEditHeadCell",
        args, 
        ac);
    XtManageChild(_lbEditHeadCell);
    create_CUIeditheader_receptor(_CUIeditheader);
    
    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNtopWidget, _swEditHeadCrysDesc); ac++;
    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
    XtSetArg(args[ac], XmNrightOffset, 0); ac++;
    XtSetValues(_separator, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_POSITION); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNbottomPosition, 66); ac++;
    XtSetArg(args[ac], XmNtopOffset, 255); ac++;
    XtSetArg(args[ac], XmNleftOffset, 175); ac++;
    XtSetValues(_swEditHeadCrysDesc, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNtopOffset, 250); ac++;
    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
    XtSetValues(_lbEditHeadCrysDesc, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNtopWidget, _separator); ac++;
    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
    XtSetArg(args[ac], XmNleftOffset, 175); ac++;
    XtSetValues(_tfEditHeadBeamPosn, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNtopWidget, _tfEditHeadBeamPosn); ac++;
    XtSetArg(args[ac], XmNtopOffset, 4); ac++;
    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
    XtSetValues(_lbEditHeadBeamPosn, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNtopWidget, _tfEditHeadSpacegroup); ac++;
    XtSetArg(args[ac], XmNleftWidget, _tfEditHeadSpacegroup); ac++;
    XtSetArg(args[ac], XmNtopOffset, 3); ac++;
    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
    XtSetArg(args[ac], XmNleftOffset, 5); ac++;
    XtSetArg(args[ac], XmNrightOffset, 0); ac++;
    XtSetValues(_pbEditHeadSpacegroup, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNtopWidget, _lbEditHeadComment); ac++;
    XtSetArg(args[ac], XmNtopOffset, 5); ac++;
    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
    XtSetArg(args[ac], XmNrightOffset, 0); ac++;
    XtSetValues(_swEditHeadComment, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNtopWidget, _tfEditHeadMosaicity); ac++;
    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
    XtSetArg(args[ac], XmNleftOffset, 175); ac++;
    XtSetValues(_tfEditHeadSpacegroup, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNtopWidget, _tfEditHeadOrient1); ac++;
    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
    XtSetArg(args[ac], XmNleftOffset, 175); ac++;
    XtSetValues(_tfEditHeadMosaicity, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNtopWidget, _tfEditHeadCellGam); ac++;
    XtSetArg(args[ac], XmNleftWidget, _tfEditHeadOrient2); ac++;
    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
    XtSetArg(args[ac], XmNleftOffset, 5); ac++;
    XtSetArg(args[ac], XmNrightOffset, 0); ac++;
    XtSetValues(_tfEditHeadOrient3, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNtopWidget, _tfEditHeadCellBet); ac++;
    XtSetArg(args[ac], XmNleftWidget, _tfEditHeadOrient1); ac++;
    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
    XtSetArg(args[ac], XmNleftOffset, 5); ac++;
    XtSetArg(args[ac], XmNrightOffset, 0); ac++;
    XtSetValues(_tfEditHeadOrient2, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNtopWidget, _tfEditHeadCellAlp); ac++;
    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
    XtSetArg(args[ac], XmNleftOffset, 175); ac++;
    XtSetValues(_tfEditHeadOrient1, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNtopWidget, _tfEditHeadCellC); ac++;
    XtSetArg(args[ac], XmNleftWidget, _tfEditHeadCellBet); ac++;
    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
    XtSetArg(args[ac], XmNleftOffset, 5); ac++;
    XtSetArg(args[ac], XmNrightOffset, 0); ac++;
    XtSetValues(_tfEditHeadCellGam, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNtopWidget, _tfEditHeadCellB); ac++;
    XtSetArg(args[ac], XmNleftWidget, _tfEditHeadCellAlp); ac++;
    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
    XtSetArg(args[ac], XmNleftOffset, 5); ac++;
    XtSetArg(args[ac], XmNrightOffset, 0); ac++;
    XtSetValues(_tfEditHeadCellBet, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNtopWidget, _tfEditHeadCellA); ac++;
    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
    XtSetArg(args[ac], XmNleftOffset, 175); ac++;
    XtSetValues(_tfEditHeadCellAlp, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNleftWidget, _tfEditHeadCellB); ac++;
    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
    XtSetArg(args[ac], XmNleftOffset, 5); ac++;
    XtSetArg(args[ac], XmNrightOffset, 0); ac++;
    XtSetValues(_tfEditHeadCellC, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNleftWidget, _tfEditHeadCellA); ac++;
    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
    XtSetArg(args[ac], XmNleftOffset, 5); ac++;
    XtSetArg(args[ac], XmNrightOffset, 0); ac++;
    XtSetValues(_tfEditHeadCellB, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
    XtSetArg(args[ac], XmNleftOffset, 175); ac++;
    XtSetValues(_tfEditHeadCellA, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNtopOffset, 385); ac++;
    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
    XtSetValues(_lbEditHeadComment, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNtopOffset, 195); ac++;
    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
    XtSetValues(_lbEditHeadSpacegroup, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNtopOffset, 145); ac++;
    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
    XtSetValues(_lbEditHeadMosaicity, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNtopOffset, 95); ac++;
    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
    XtSetValues(_lbEditHeadOrientation, args, ac);
    
    ac = 0;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
    XtSetValues(_lbEditHeadCell, args, ac);
    
    // Begin user code block <endcreate> 

    // Create the help object and add the help callback

    m_poXhelp     = new CXhelp (_w);

    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object = (UIComponent *)m_poXhelp;
    _clientDataStructs->client_data = (XtPointer) "EditHeader$$";
    XtAddCallback(_CUIeditheader,
        XmNhelpCallback,
        CXhelp::vHTMLHelpCallback,
        (XtPointer)_clientDataStructs);


#if (XmVersion >= 1002)
    // Add help callback for textFields

    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object =  (UIComponent *)m_poXhelp;
    _clientDataStructs->client_data 
      = (XtPointer)"Unit cell dimension a in Angstroms",
    XtAddCallback(_tfEditHeadCellA,
        XmNfocusCallback,
        CXhelp::vPostOneLineCBCallback,
        (XtPointer)_clientDataStructs);
    XtAddCallback(_tfEditHeadCellA,
        XmNlosingFocusCallback,
        CXhelp::vUnpostOneLineCBCallback,
        (XtPointer)_clientDataStructs);

    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object =  (UIComponent *)m_poXhelp;
    _clientDataStructs->client_data 
      = (XtPointer)"Unit cell dimension a in Angstroms",
    XtAddCallback(_tfEditHeadCellA,
        XmNfocusCallback,
        CXhelp::vPostOneLineCBCallback,
        (XtPointer)_clientDataStructs);

    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object =  (UIComponent *)m_poXhelp;
    _clientDataStructs->client_data 
      = (XtPointer)"Unit cell dimension b in Angstroms",
    XtAddCallback(_tfEditHeadCellB,
        XmNfocusCallback,
        CXhelp::vPostOneLineCBCallback,
        (XtPointer)_clientDataStructs);
    XtAddCallback(_tfEditHeadCellB,
        XmNlosingFocusCallback,
        CXhelp::vUnpostOneLineCBCallback,
        (XtPointer)_clientDataStructs);

    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object =  (UIComponent *)m_poXhelp;
    _clientDataStructs->client_data 
      = (XtPointer)"Unit cell dimension c in Angstroms",
    XtAddCallback(_tfEditHeadCellC,
        XmNfocusCallback,
        CXhelp::vPostOneLineCBCallback,
        (XtPointer)_clientDataStructs);
    XtAddCallback(_tfEditHeadCellC,
        XmNlosingFocusCallback,
        CXhelp::vUnpostOneLineCBCallback,
        (XtPointer)_clientDataStructs);

    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object =  (UIComponent *)m_poXhelp;
    _clientDataStructs->client_data 
      = (XtPointer)"Unit cell angle alpha in degrees",
    XtAddCallback(_tfEditHeadCellAlp,
        XmNfocusCallback,
        CXhelp::vPostOneLineCBCallback,
        (XtPointer)_clientDataStructs);
    XtAddCallback(_tfEditHeadCellAlp,
        XmNlosingFocusCallback,
        CXhelp::vUnpostOneLineCBCallback,
        (XtPointer)_clientDataStructs);

    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object =  (UIComponent *)m_poXhelp;
    _clientDataStructs->client_data 
      = (XtPointer)"Unit cell angle beta in degrees",
    XtAddCallback(_tfEditHeadCellBet,
        XmNfocusCallback,
        CXhelp::vPostOneLineCBCallback,
        (XtPointer)_clientDataStructs);
    XtAddCallback(_tfEditHeadCellBet,
        XmNlosingFocusCallback,
        CXhelp::vUnpostOneLineCBCallback,
        (XtPointer)_clientDataStructs);

    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object =  (UIComponent *)m_poXhelp;
    _clientDataStructs->client_data 
      = (XtPointer)"Unit cell angle gamma in degrees",
    XtAddCallback(_tfEditHeadCellGam,
        XmNfocusCallback,
        CXhelp::vPostOneLineCBCallback,
        (XtPointer)_clientDataStructs);
    XtAddCallback(_tfEditHeadCellGam,
        XmNlosingFocusCallback,
        CXhelp::vUnpostOneLineCBCallback,
        (XtPointer)_clientDataStructs);

    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object =  (UIComponent *)m_poXhelp;
    _clientDataStructs->client_data 
      = (XtPointer)"Crystal orientation angle 1 in degrees",
    XtAddCallback(_tfEditHeadOrient1,
        XmNfocusCallback,
        CXhelp::vPostOneLineCBCallback,
        (XtPointer)_clientDataStructs);
    XtAddCallback(_tfEditHeadOrient1,
        XmNlosingFocusCallback,
        CXhelp::vUnpostOneLineCBCallback,
        (XtPointer)_clientDataStructs);

    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object =  (UIComponent *)m_poXhelp;
    _clientDataStructs->client_data 
      = (XtPointer)"Crystal orientation angle 2 in degrees",
    XtAddCallback(_tfEditHeadOrient2,
        XmNfocusCallback,
        CXhelp::vPostOneLineCBCallback,
        (XtPointer)_clientDataStructs);
    XtAddCallback(_tfEditHeadOrient2,
        XmNlosingFocusCallback,
        CXhelp::vUnpostOneLineCBCallback,
        (XtPointer)_clientDataStructs);

    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object =  (UIComponent *)m_poXhelp;
    _clientDataStructs->client_data 
      = (XtPointer)"Crystal orientation angle 3 in degrees",
    XtAddCallback(_tfEditHeadOrient3,
        XmNfocusCallback,
        CXhelp::vPostOneLineCBCallback,
        (XtPointer)_clientDataStructs);
    XtAddCallback(_tfEditHeadOrient3,
        XmNlosingFocusCallback,
        CXhelp::vUnpostOneLineCBCallback,
        (XtPointer)_clientDataStructs);

    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object =  (UIComponent *)m_poXhelp;
    _clientDataStructs->client_data 
      = (XtPointer)"Crystal effective mosaic spread in degrees",
    XtAddCallback(_tfEditHeadMosaicity,
        XmNfocusCallback,
        CXhelp::vPostOneLineCBCallback,
        (XtPointer)_clientDataStructs);
    XtAddCallback(_tfEditHeadMosaicity,
        XmNlosingFocusCallback,
        CXhelp::vUnpostOneLineCBCallback,
        (XtPointer)_clientDataStructs);

    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object =  (UIComponent *)m_poXhelp;
    _clientDataStructs->client_data 
      = (XtPointer)"Crystal spacegroup number",
    XtAddCallback(_tfEditHeadSpacegroup,
        XmNfocusCallback,
        CXhelp::vPostOneLineCBCallback,
        (XtPointer)_clientDataStructs);
    XtAddCallback(_tfEditHeadSpacegroup,
        XmNlosingFocusCallback,
        CXhelp::vUnpostOneLineCBCallback,
        (XtPointer)_clientDataStructs);

    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object =  (UIComponent *)m_poXhelp;
    _clientDataStructs->client_data 
      = (XtPointer)"A general comment about this data collection",
    XtAddCallback(_twEditHeadComment,
        XmNfocusCallback,
        CXhelp::vPostOneLineCBCallback,
        (XtPointer)_clientDataStructs);
    XtAddCallback(_twEditHeadComment,
        XmNlosingFocusCallback,
        CXhelp::vUnpostOneLineCBCallback,
        (XtPointer)_clientDataStructs);

    _clientDataStructs = new UICallbackStruct;
    _clientDataStructs->object =  (UIComponent *)m_poXhelp;
    _clientDataStructs->client_data 
      = (XtPointer)"Direct beam position in pixels when 2theta at 0",
    XtAddCallback(_tfEditHeadBeamPosn,
        XmNfocusCallback,
        CXhelp::vPostOneLineCBCallback,
        (XtPointer)_clientDataStructs);
    XtAddCallback(_tfEditHeadBeamPosn,
        XmNlosingFocusCallback,
        CXhelp::vUnpostOneLineCBCallback,
        (XtPointer)_clientDataStructs);
#endif

    // Fix up _sdEditHeader display

    XtUnmanageChild(XmSelectionBoxGetChild(baseWidget(), XmDIALOG_TEXT));
    XtUnmanageChild(XmSelectionBoxGetChild(baseWidget(), 
					   XmDIALOG_SELECTION_LABEL));
    XtManageChild(XmSelectionBoxGetChild(baseWidget(),
					 XmDIALOG_APPLY_BUTTON));

    XtVaSetValues(baseWidget(), XmNdefaultButton,
		  XmSelectionBoxGetChild(baseWidget(),
					 XmDIALOG_APPLY_BUTTON),
		  NULL);

    m_ptfWidgets[0] = &_tfEditHeadCellA;
    m_ptfWidgets[1] = &_tfEditHeadCellB;
    m_ptfWidgets[2] = &_tfEditHeadCellC;
    m_ptfWidgets[3] = &_tfEditHeadCellAlp;
    m_ptfWidgets[4] = &_tfEditHeadCellBet;
    m_ptfWidgets[5] = &_tfEditHeadCellGam;
    m_ptfWidgets[6] = &_tfEditHeadOrient1;
    m_ptfWidgets[7] = &_tfEditHeadOrient2;
    m_ptfWidgets[8] = &_tfEditHeadOrient3;
    m_ptfWidgets[9] = &_tfEditHeadMosaicity;
    m_ptfWidgets[10]= &_tfEditHeadSpacegroup;
    m_ptfWidgets[11]= &_tfEditHeadBeamPosn;
    
    // End user code block <endcreate> 
}

//
// Empty virtual function for subclass' receptor children.
//
void CUIeditheader::create_CUIeditheader_receptor(Widget)
{
}

//
// Classname access.
//
const char *const CUIeditheader::className()
{
    return ("CUIeditheader");
}

void CUIeditheader::vEditHeaderCBCallback(Widget w, 
		XtPointer clientData, XtPointer callData)
{
    UICallbackStruct *data = (UICallbackStruct *) clientData;
    CUIeditheader *obj = (CUIeditheader *)data->object;
    obj->vEditHeaderCB(w, data->client_data, callData);
}

void CUIeditheader::vEditHeaderCB (Widget w, XtPointer clientData, XtPointer callData)
{
    
    // Begin user code block <vEditHeaderCB> 

  if (w == NULL)
    {
      // Copy current crystal values to sdEditHeader selection dialog then
      // manage the dialog
  
      vUpdateWidgets();

      XtManageChild(baseWidget());
    }
  else if (w == baseWidget())
    {
      // Callback was (supposedly) from _sdEditHeader selection dialog

      XmSelectionBoxCallbackStruct *pCBS 
	= (XmSelectionBoxCallbackStruct *)callData;
      if ( (XmCR_OK == pCBS->reason) || (XmCR_APPLY == pCBS->reason) )
	{
//	  cout << "OK or APPLY!\n";
	  vReadWidgets();

	  if (NULL != m_prvCallback)
	    {
	      m_prvCallback(m_pObj, m_tEditHeader);
	    }
	}
      else if (XmCR_CANCEL == pCBS->reason)
	{
	  // Do nothing ...
	}
      else if (XmCR_HELP == pCBS->reason)
	{
	  // Post html help dialog ...
	  //
	}
    }
    // End user code block <vEditHeaderCB> 
}

void CUIeditheader::vTextFieldCBCallback(Widget w, 
		XtPointer clientData, XtPointer callData)
{
    UICallbackStruct *data = (UICallbackStruct *) clientData;
    CUIeditheader *obj = (CUIeditheader *)data->object;
    obj->vTextFieldCB(w, data->client_data, callData);
}

void CUIeditheader::vTextFieldCB (Widget w, XtPointer clientData, XtPointer callData)
{
    
    // Begin user code block <vTextFieldCB> 

  XmAnyCallbackStruct *pCBS = (XmAnyCallbackStruct *)callData;

  char  *pcTemp;
  double dTemp;
  double a2dTemp[2];
  int    nTemp;
  int    nStat;
  int    i;
  pcTemp = XmTextFieldGetString(w);
//  cout << "TEXT CB\n";
  if (XmIsTextField(w))
    {
      if (XmCR_ACTIVATE == pCBS->reason)
	XmProcessTraversal(w, XmTRAVERSE_NEXT_TAB_GROUP);
    }
  if (NULL != pcTemp)
    {
      if (w == _tfEditHeadBeamPosn)
	{
	  nStat = sscanf(pcTemp, "%lf, %lf", &a2dTemp[0], &a2dTemp[1]);
	  if (2 != nStat)
	    nStat = sscanf(pcTemp, "%lf %lf", &a2dTemp[0], &a2dTemp[1]);
	  if (2 == nStat) nStat = 1;
	}
      else
	{
	  nStat = sscanf(pcTemp, "%lf", &dTemp);
	}
	
      if (w == _tfEditHeadSpacegroup)
	{
	  // It is the spacegroup field, which should be an integer
	  
	  sprintf(m_a255cTemp, "%.0lf", dTemp);
	}
      else if (w == _tfEditHeadBeamPosn)
	{
	  sprintf(m_a255cTemp, "%.2lf, %.2lf", a2dTemp[0], a2dTemp[1]);
	}
      else
	{
	  sprintf(m_a255cTemp, m_sFormat2.string(), dTemp);
	}

      if (1 == nStat)
	{
	  XmTextFieldSetString(w, m_a255cTemp);
	}
      else
	{
	  // Failure to read field correctly, restore to what should have
	  // been there.
	}
      XtFree(pcTemp);
    }
    // End user code block <vTextFieldCB> 
}

void CUIeditheader::vUnPostHelpCallback(Widget w, 
		XtPointer clientData, XtPointer callData)
{
    UICallbackStruct *data = (UICallbackStruct *) clientData;
    CUIeditheader *obj = (CUIeditheader *)data->object;
    obj->vUnPostHelp(w, data->client_data, callData);
}

void CUIeditheader::vUnPostHelp (Widget w, XtPointer clientData, XtPointer callData)
{
    
    // Begin user code block <vUnPostHelp> 
    // End user code block <vUnPostHelp> 
}

// Begin user code block <tail> 

void CUIeditheader::vPostHelpCallback(Widget w, 
		XtPointer clientData, XtPointer callData)
{
    UICallbackStruct *data = (UICallbackStruct *) clientData;
    CUIeditheader *obj = (CUIeditheader *)data->object;
    obj->vPostHelp(w, data->client_data, callData);
}

void CUIeditheader::vPostHelp (Widget w, XtPointer clientData, XtPointer callData)
{
    
    // Begin user code block <vPostHelp> 
  if (NULL != m_poXhelp)
    {
      m_poXhelp->vPostOneLineCB(w, clientData, callData);
    }
}

void
CUIeditheader::manage()
{
  vUpdateWidgets();
  UIComponent::manage();
}

void
CUIeditheader::vSetValues(const tagEditHeader& ptProps)
{
  m_tEditHeader.dCrysCell[0]     = ptProps.dCrysCell[0];
  m_tEditHeader.dCrysCell[1]     = ptProps.dCrysCell[1];
  m_tEditHeader.dCrysCell[2]     = ptProps.dCrysCell[2];
  m_tEditHeader.dCrysCell[3]     = ptProps.dCrysCell[3];
  m_tEditHeader.dCrysCell[4]     = ptProps.dCrysCell[4];
  m_tEditHeader.dCrysCell[5]     = ptProps.dCrysCell[5];
  m_tEditHeader.dCrysRot[0]      = ptProps.dCrysRot[0];
  m_tEditHeader.dCrysRot[1]      = ptProps.dCrysRot[1];
  m_tEditHeader.dCrysRot[2]      = ptProps.dCrysRot[2];
  m_tEditHeader.dCrysMosaicity   = ptProps.dCrysMosaicity;
  m_tEditHeader.nCrysSpacegroup  = ptProps.nCrysSpacegroup;
  m_tEditHeader.dBeamPosition[0] = ptProps.dBeamPosition[0];
  m_tEditHeader.dBeamPosition[1] = ptProps.dBeamPosition[1];
  m_tEditHeader.sCrysDescription = ptProps.sCrysDescription;
  m_tEditHeader.sComment         = ptProps.sComment;

  vUpdateWidgets();
}

void
CUIeditheader::vGetValues(tagEditHeader* ptProps)
{
  // First read the widget values

  vReadWidgets();

  ptProps->dCrysCell[0]     = m_tEditHeader.dCrysCell[0];
  ptProps->dCrysCell[1]     = m_tEditHeader.dCrysCell[1];
  ptProps->dCrysCell[2]     = m_tEditHeader.dCrysCell[2];
  ptProps->dCrysCell[3]     = m_tEditHeader.dCrysCell[3];
  ptProps->dCrysCell[4]     = m_tEditHeader.dCrysCell[4];
  ptProps->dCrysCell[5]     = m_tEditHeader.dCrysCell[5];
  ptProps->dCrysRot[0]      = m_tEditHeader.dCrysRot[0];
  ptProps->dCrysRot[1]      = m_tEditHeader.dCrysRot[1];
  ptProps->dCrysRot[2]      = m_tEditHeader.dCrysRot[2];
  ptProps->dCrysMosaicity   = m_tEditHeader.dCrysMosaicity;
  ptProps->nCrysSpacegroup  = m_tEditHeader.nCrysSpacegroup;
  ptProps->dBeamPosition[0] = m_tEditHeader.dBeamPosition[0];
  ptProps->dBeamPosition[1] = m_tEditHeader.dBeamPosition[1];
  ptProps->sCrysDescription = m_tEditHeader.sCrysDescription;
  ptProps->sComment         = m_tEditHeader.sComment;

}

void
CUIeditheader::vUpdateWidgets(void)
{
  sprintf(m_a255cTemp, m_sFormat2.string(), m_tEditHeader.dCrysCell[0]);
  XmTextFieldSetString(_tfEditHeadCellA, m_a255cTemp);
  sprintf(m_a255cTemp, m_sFormat2.string(), m_tEditHeader.dCrysCell[1]);
  XmTextFieldSetString(_tfEditHeadCellB, m_a255cTemp);
  sprintf(m_a255cTemp, m_sFormat2.string(), m_tEditHeader.dCrysCell[2]);
  XmTextFieldSetString(_tfEditHeadCellC, m_a255cTemp);
  sprintf(m_a255cTemp, m_sFormat2.string(), m_tEditHeader.dCrysCell[3]);
  XmTextFieldSetString(_tfEditHeadCellAlp, m_a255cTemp);
  sprintf(m_a255cTemp, m_sFormat2.string(), m_tEditHeader.dCrysCell[4]);
  XmTextFieldSetString(_tfEditHeadCellBet, m_a255cTemp);
  sprintf(m_a255cTemp, m_sFormat2.string(), m_tEditHeader.dCrysCell[5]);
  XmTextFieldSetString(_tfEditHeadCellGam, m_a255cTemp);
  
  sprintf(m_a255cTemp, m_sFormat2.string(), m_tEditHeader.dCrysRot[0]);
  XmTextFieldSetString(_tfEditHeadOrient1, m_a255cTemp);
  sprintf(m_a255cTemp, m_sFormat2.string(), m_tEditHeader.dCrysRot[1]);
  XmTextFieldSetString(_tfEditHeadOrient2, m_a255cTemp);
  sprintf(m_a255cTemp, m_sFormat2.string(), m_tEditHeader.dCrysRot[2]);
  XmTextFieldSetString(_tfEditHeadOrient3, m_a255cTemp);
  sprintf(m_a255cTemp, m_sFormat1.string(), m_tEditHeader.dCrysMosaicity);
  XmTextFieldSetString(_tfEditHeadMosaicity, m_a255cTemp);
  sprintf(m_a255cTemp, "%d", m_tEditHeader.nCrysSpacegroup);
  XmTextFieldSetString(_tfEditHeadSpacegroup, m_a255cTemp);

  sprintf(m_a255cTemp, "%.2lf, %.2lf", m_tEditHeader.dBeamPosition[0],
	  m_tEditHeader.dBeamPosition[1]);
  XmTextFieldSetString(_tfEditHeadBeamPosn, m_a255cTemp);
  
  XmTextSetString(_twEditHeadCrysDesc, m_tEditHeader.sCrysDescription.string());

  XmTextSetString(_twEditHeadComment, m_tEditHeader.sComment.string());
}

void
CUIeditheader::vReadWidgets(void)
{
  // Copy text field values to m_tEditHeader
  // variables
	  
  char  *pcTemp;
  double dTemp;
  double a2dTemp[2];
  double a13dTemp[13];
  int    nStat;
  int    i;

  a13dTemp[0] = m_tEditHeader.dCrysCell[0];
  a13dTemp[1] = m_tEditHeader.dCrysCell[1];
  a13dTemp[2] = m_tEditHeader.dCrysCell[2];
  a13dTemp[3] = m_tEditHeader.dCrysCell[3];
  a13dTemp[4] = m_tEditHeader.dCrysCell[4];
  a13dTemp[5] = m_tEditHeader.dCrysCell[5];
  a13dTemp[6] = m_tEditHeader.dCrysRot[0];
  a13dTemp[7] = m_tEditHeader.dCrysRot[1];
  a13dTemp[8] = m_tEditHeader.dCrysRot[2];
  a13dTemp[9] = m_tEditHeader.dCrysMosaicity;
  a13dTemp[10] = (double) m_tEditHeader.nCrysSpacegroup;
  a13dTemp[11] = m_tEditHeader.dBeamPosition[0];
  a13dTemp[12] = m_tEditHeader.dBeamPosition[1];

  for (i = 0; i < 11; i++)
    {
      pcTemp = XmTextFieldGetString(*m_ptfWidgets[i]);
      if (NULL != pcTemp)
	{
	  nStat  = sscanf(pcTemp, "%lf", &dTemp);
	  if (1 == nStat)
	    {
	      a13dTemp[i] = dTemp;
	    }
	  XtFree(pcTemp);
	}
    }

  pcTemp = XmTextFieldGetString(_tfEditHeadBeamPosn);
  if (NULL != pcTemp)
    {
      nStat = sscanf(pcTemp, "%lf,%lf", &a2dTemp[0], &a2dTemp[1]);
      if (1 <= nStat)
	a13dTemp[11] = a2dTemp[0];
      if (2 <= nStat)
	{
	  a13dTemp[12] = a2dTemp[1];
	}
      XtFree(pcTemp);
    }

  m_tEditHeader.dCrysCell[0]    = a13dTemp[0];
  m_tEditHeader.dCrysCell[1]    = a13dTemp[1];
  m_tEditHeader.dCrysCell[2]    = a13dTemp[2];
  m_tEditHeader.dCrysCell[3]    = a13dTemp[3];
  m_tEditHeader.dCrysCell[4]    = a13dTemp[4];
  m_tEditHeader.dCrysCell[5]    = a13dTemp[5];
  m_tEditHeader.dCrysRot[0]     = a13dTemp[6];
  m_tEditHeader.dCrysRot[1]     = a13dTemp[7];
  m_tEditHeader.dCrysRot[2]     = a13dTemp[8];
  m_tEditHeader.dCrysMosaicity  = a13dTemp[9];
  m_tEditHeader.nCrysSpacegroup = (int) a13dTemp[10];
  m_tEditHeader.dBeamPosition[0]= a13dTemp[11];
  m_tEditHeader.dBeamPosition[1]= a13dTemp[12];

  pcTemp = XmTextGetString(_twEditHeadComment);
  if (NULL != pcTemp)
    {
      m_tEditHeader.sComment = pcTemp;
      XtFree(pcTemp);
    }

  pcTemp = XmTextGetString(_twEditHeadCrysDesc);
  if (NULL != pcTemp)
    {
      m_tEditHeader.sCrysDescription = pcTemp;
      XtFree(pcTemp);
    }
}
// End user code block <tail> 
